package com.csw.service;

import com.csw.dao.ShareDao;
import com.csw.entity.Share;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ShareServiceImpl implements ShareService {
    @Autowired
    private ShareDao shareDao;

    @Override
    public List<Share> queryAllFile(String toid) {
        List<Share> shareList = shareDao.queryAllFile(toid);
        return shareList;
    }

    @Override
    public List<Share> queryAllDir(String toid) {
        List<Share> shareList = shareDao.queryAllDir(toid);
        return shareList;
    }

    @Override
    public void insert(Share share) {
        shareDao.insert(share);
    }

    @Override
    public Share queryById(String fid) {
        return shareDao.queryById(fid);
    }

    @Override
    public Share queryById2(String fid) {
        return shareDao.queryById2(fid);
    }

    @Override
    public void deleteById(String id) {
        shareDao.deleteById(id);
    }

    @Override
    public List<Share> queryAllFiles() {
        List<Share> shares = shareDao.queryAllFiles();
        return shares;
    }

    @Override
    public List<Share> queryAllDirs() {
        List<Share> shares = shareDao.queryAllDirs();
        return shares;
    }

    @Override
    public List<Share> queryAllFilesLike(String inSearchName) {
        List<Share> shares = shareDao.queryAllFilesLike(inSearchName);
        return shares;
    }

    @Override
    public List<Share> queryAllDirsLikes(String inSearchName) {
        List<Share> shares = shareDao.queryAllDirsLikes(inSearchName);
        return shares;
    }


}
